package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author quankk
 * @since 2019-05-16
 */
@TableName("tt_sms_log")
public class SmsLogPO extends DMSBasePO<SmsLogPO> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 短信内容
     */
    @TableField("content")
    private String content;
    /**
     * 手机号
     */
    @TableField("mobile")
    private String mobile;
    /**
     * 请求地址
     */
    @TableField("url")
    private String url;
    /**
     * 返回结果
     */
    @TableField("return_message")
    private String returnMessage;
    /**
     * 验证码
     */
    @TableField("CHECK_CODE")
    private String checkCode;
    /**
     * 1：注册，2：登录，3：忘记密码
     */
    @TableField("SMS_TYPE")
    private BigDecimal smsType;
    /**
     * 最后校验时间
     */
    @TableField("LAST_CHECK_TIME")
    private LocalDateTime lastCheckTime;
    /**
     * 错误次数
     */
    @TableField("ERROR_COUNT")
    private Integer errorCount;

    /**
     * 超时分钟数
     */
    @TableField("MINUTE")
    private Integer minute;

    private String appId;

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public SmsLogPO() {
        super();
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getReturnMessage() {
        return returnMessage;
    }

    public void setReturnMessage(String returnMessage) {
        this.returnMessage = returnMessage;
    }

    public String getCheckCode() {
        return checkCode;
    }

    public void setCheckCode(String checkCode) {
        this.checkCode = checkCode;
    }

    public BigDecimal getSmsType() {
        return smsType;
    }

    public void setSmsType(BigDecimal smsType) {
        this.smsType = smsType;
    }

    public LocalDateTime getLastCheckTime() {
        return lastCheckTime;
    }

    public void setLastCheckTime(LocalDateTime lastCheckTime) {
        this.lastCheckTime = lastCheckTime;
    }

    public Integer getErrorCount() {
        return errorCount;
    }

    public void setErrorCount(Integer errorCount) {
        this.errorCount = errorCount;
    }

    public Integer getMinute() {
        return minute;
    }

    public void setMinute(Integer minute) {
        this.minute = minute;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "SmsLogPO{" +
                "id=" + id +
                ", content='" + content + '\'' +
                ", mobile='" + mobile + '\'' +
                ", url='" + url + '\'' +
                ", returnMessage='" + returnMessage + '\'' +
                ", checkCode='" + checkCode + '\'' +
                ", smsType=" + smsType +
                ", lastCheckTime=" + lastCheckTime +
                ", errorCount=" + errorCount +
                ", appId='" + appId + '\'' +
                '}';
    }

    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author quankk
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "id");
    }


}
